/******************************************************************************\
 * Filename   : bwenc_vi.h
 * Copyright  : 
 * Created    : 2018-10-31 by litao
 * Description:
 * 
\******************************************************************************/

#ifndef __ENC_VI_H__
#define __ENC_VI_H__

#include "enc_common.h"

#define ENC_HDMI_I2C0DEV	"/dev/i2c-0"
#define ENC_HDMI_I2C1DEV	"/dev/i2c-1"
#define ENC_HDMI_I2C0SEM	"enci2c0sem"
#define ENC_HDMI_I2C1SEM	"enci2c1sem"

#define ENC_HDMI_IOADDR		0x98
#define ENC_HDMI1_I2CADDR	0x98
#define ENC_HDMI2_I2CADDR	0x9A
#define ENC_HDMI3_I2CADDR	0x98
#define ENC_HDMI4_I2CADDR	0x9A

#define ENC_HDMI_CECMAPREG	0xF4
#define ENC_HDMI_INFOMAPREG	0xF5
#define ENC_HDMI_DPLLMAPREG	0xF8
#define ENC_HDMI_KSVMAPREG	0xF9
#define ENC_HDMI_EDIDMAPREG	0xFA
#define ENC_HDMI_HDMIMAPREG	0xFB
#define ENC_HDMI_CPMAPREG	0xFD

#define ENC_HDMI1_MAPSTART	0x10
#define ENC_HDMI2_MAPSTART	0x20
#define ENC_HDMI3_MAPSTART	0x30
#define ENC_HDMI4_MAPSTART	0x40

#define I2C_SLAVE       	0x0703  /* Use this slave address */
#define I2C_SLAVE_FORCE 	0x0706 /* Use this slave address, even if it is already in use by a driver! */

#define I2C_16BIT_REG   	0x0709  /* 16BIT REG WIDTH */
#define I2C_16BIT_DATA  	0x070a  /* 16BIT DATA WIDTH */


typedef struct _enc_hdmi_cmd
{
	uint8_t *i2c_addr;
	uint8_t *reg_addr;
	uint8_t value;
}enc_hdmi_cmd;

extern HI_S32 enc_vi_start(int chan_num, stENC_VI_INFO *p_videoin);
extern HI_S32 enc_vi_stop(int chan_num);
extern HI_S32 enc_vi_BindVpss(HI_S32 chan_num);
extern HI_S32 enc_vi_UnBindVpss(HI_S32 chan_num);

#endif

